<?php 
if ($js){
?>
<!DOCTYPE html>
<html lang="id">
<head>
	<title><?php echo PROJECT_NAME ;?></title>
	<meta charset="utf-8">
	<meta content='id' http-equiv='Content-Language'/>
	<meta content='<?php echo PROJECT_NAME ;?>' name='description'/>
	<meta content='INDEX,NOFOLLOW' name='robots'/>
	<meta content='<?php echo PROJECT_NAME ;?>' name='keywords'/>
	<meta content='1 days' name='revisit-after'/>
	<meta content='1 days' name='revisit'/>
	<link href='#' rel='shortcut icon'/>
	<?php
		// ASSETS //;
		echo js_asset('jquery-1.8.3.min.js','jquery-ui-bootstrap');
		
		echo css_asset('bootstrap.css','bootstrap');
		echo css_asset('bootstrap-responsive.min.css','bootstrap');
		echo css_asset('bootstrap-custom.css','bootstrap');
		
		echo css_asset('style.css');
		echo css_asset('heading.css');
		echo css_asset('color.css');
		echo css_asset('font.css');
		echo css_asset('align.css');
		echo css_asset('icon.css');
	?>
<?php } ?>
	<script>
		$(function(){
			form = $("#form-laporan<?php echo @$file; ?>");
			btnSimpanlaporan = $("#btn-simpanlaporan<?php echo @$file; ?>");
			cmbCabang = $("#cmb-cabanglaporan<?php echo @$file; ?>");
			cmbTahun = $("#cmb-tahun<?php echo @$file; ?>");
			btnSimpanlaporan.click(function(){
				if (cmbCabang.val() == "0" || cmbTahun.val() == "0"){
					alert("Pilih Cabang dan tahun terlebih dahulu!");
				}else{
					form.submit();
				}
			});
            
            
            $("#cmb-pekanawal ,#cmb-pekanakhir").change(function(){
                pekanakhir = $("#cmb-pekanakhir").val();
                pekanawal =  $("#cmb-pekanawal").val();
                if(parseInt(pekanakhir) < parseInt(pekanawal)){
                    $("#cmb-pekanakhir").val(pekanawal);
                }
            });
		});
	</script>
	<?php 
if ($js){
?>
</head>
<body data-twttr-rendered="true" data-spy="scroll" data-target=".bs-docs-sidebar">
<div id="main-content" style="width:500px;margin:10px auto">
<div id="content">
<?php } ?>
<form id="form-laporan<?php echo @$file; ?>" class="form-horizontal" action="<?php echo base_url() ?>c_laporan/<?php echo @$file."/true"; ?>" target="laporan<?php echo @$file;?>" method="POST">
    
    <?php if($file != "tenderpekan"){ ?>
	<div class="control-group">
		<label class="control-label left" for="nama">Cabang</label>
		<div class="controls">
			<?php echo form_dropdown("cmb-cabang",$data_cabang,"","id=cmb-cabanglaporan".@$file); ?>	
		</div>
	</div>
    <?php } ?>
	<div class="control-group">
		<label class="control-label left" for="nama">Tahun</label>
		<div class="controls">
			<?php echo form_dropdown("cmb-tahun",$data_tahun,date("Y"),"id=cmb-tahun".@$file ); ?>	
		</div>
	</div>
    <?php if($file == "tenderpekan"){ ?>
    
	<div class="control-group">
		<label class="control-label left" for="nama">Pekan</label>
		<div class="controls">
			<?php 
                for($i=1;$i<=53;$i++){
                    $pekan[$i] = $i;
                }
                echo form_dropdown("cmb-pekanawal",$pekan,date("W"),"id=cmb-pekanawal class='span2'".@$file ); ?>	s/d <?php
                                     
                echo form_dropdown("cmb-pekanakhir",$pekan,date("W"),"id=cmb-pekanakhir class='span2'".@$file ); ?>
		</div>
	</div>
    <?php } ?>
	<div class="form-actions">
		<button type="button" class="btn btn-primary" id="btn-simpanlaporan<?php echo @$file; ?>">Proses</button>
		<button type="reset" class="btn" id="btn-resetlaporan<?php echo @$file; ?>">Reset</button>
	</div>
</form>
<?php if ($js){ ?>
</div>
</div>
</body>
</html>
<?php }else{ ?>
	<iframe name="laporan<?php echo @$file;?>" width="100%" height="1000" style="border:0px">
	</iframe>
<?php } ?>